import React from 'react'
import Carde from '../Carde/Carde';
import "./Goods.less"
export default function Goods(props) {
    let { goods,n,setN} = props
    return (
        <div className="goods">
            <p> 
            {goods.map((item,index)=>(<span  className={index===n?'active':''} key=
            {index} onClick={()=>(setN(index))}>{index}</span>))}
            </p>
            {goods[n]?goods[n].content.map((item,index)=>{
                return <Carde key={index} list={item} {...props}></Carde>
             }):null}
        </div>
    )
}
